﻿using System;
using System.Collections;
using System.Linq;
using System.Data.Entity;

namespace iBackupExplorer.Data
{
    internal class NotesDal : IDisposable
    {
        private static readonly NotesDal _notesDalInstance = new NotesDal();
        private readonly NotesContext _objContext;

        static NotesDal()
        {
        }

        private NotesDal()
        {
            _objContext = new NotesContext();
        }

        public static NotesDal GetInstance
        {
            get { return _notesDalInstance; }
        }

        #region IDisposable Members

        public void Dispose()
        {
            _objContext.Dispose();
            GC.SuppressFinalize(this);
        }

        #endregion

        public IList getNotes()
        {
            return _objContext.ZNoteBody.Include(x=>x.ZNote).ToList();
        }
    }
}
